;; Copyright © 2021, 2022 Joshua Branson <jbranso@dismail.de>
;;
;; It is probably NOT possible to run sway on qemu, since qemu is running on X!

(use-modules (gnu))

(use-service-modules avahi
                     base
                     desktop
                     networking
                     sound
                     ssh
                     xorg)

(use-package-modules base ssh)

;; allegedly %desktop-services now contains network-manager-applet...?  Can I remove that?
(define %my-desktop-services
  (modify-services %desktop-services
    (delete avahi-service-type)
    ;;(delete cups-pk-helper-service-type)
    (delete bluetooth-service)
    (delete colord-service-type)
    (delete gdm-service-type)
    (delete geoclue-service)
    (delete pulseaudio-service-type)
    (delete alsa-service-type)
    (delete network-manager-service-type)
    (delete wpa-supplicant-service-type)
    (delete screen-locker-service)
    (delete upower-service-type)
    (delete udisks-service)
    ))

(operating-system
  (host-name "crazyhorse")
  (timezone "America/Indiana/Indianapolis")
  (locale "en_US.utf8")
  ;;(initrd-modules (list "e1000e" "i915" %base-initrd-modules))
  ;; when I reboot, does cat /proc/cmdline still show that I blacklisted:
  ;; modprobe.blacklist=usbmouse,usbkbd  ?
  (keyboard-layout (keyboard-layout "us" "dvorak"
                                    #:model "thinkpad"
                                    #:options '("ctrl:swapcaps")))
  ;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
  ;; target hard disk, and "my-root" is the label of the target
  ;; root file system.
  (bootloader (bootloader-configuration
               (bootloader grub-bootloader)
               (targets (list "/dev/sda"))))
  (file-systems
   (cons*
    (file-system
     (mount-point "/")
     (device "/dev/sda1")
     (type "ext4"))
    %base-file-systems))

  (users (cons* (user-account
                 (name "joshua")
                 (comment "Joshua Branson")
                 (group "users")
                 (home-directory "/home/joshua")
                 (supplementary-groups '("wheel" "audio" "video" "kvm" "netdev")))
                %base-user-accounts))

  ;; Globally-installed packages.
  (packages (append (map specification->package
                         '("sway" "emacs" "foot" "wterm" "dbus" "nss-certs"))
                    %base-packages))

  ;; Add services to the baseline: a DHCP client and
  ;; an SSH server.
  (services
   (cons*
    (service dhcp-client-service-type)
    (service openssh-service-type
             (openssh-configuration
              (openssh openssh-sans-x)
              (port-number 2222)))
    %my-desktop-services)))
